function results = predictRegress(y,x,J,nwLag)
T = size(y,1) ;
for j=1:J
    if j == 1
        Y = y(1+j:T-(J-j),1);
    else
        Y = Y + y(1+j:T-(J-j),1);
    end
end
X = [ones(size(Y,1),1) x(1:T-J,:)];
results           = nwest(Y,X,nwLag);
results.beta_se   = results.beta./results.tstat;
numBeta           = length(results.beta);
if T < 1000 && nwLag>0 
    numBoot = 10000;
    windowBoot = nwLag;
    [R2_seBoot,R2pctile,beta_seBoot,beta_pctile] = getR2SEboot(Y,X,windowBoot,numBoot); 
    results.R2_seBoot = R2_seBoot;
    results.R2pctile  = R2pctile;
    results.beta_seBoot = beta_seBoot;
    results.betapctile  = beta_pctile;
else
    results.R2_seBoot = NaN;
    results.R2pctile  = NaN(1,2);
    results.beta_seBoot = NaN(numBeta,1);
    results.betapctile  = NaN(numBeta,2);
end
end
